package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;

@Component
public class InstanceA {

    @Autowired
    private InstanceB instanceB;

    public void speak(@RequestBody ScheduleRequest request) {
        instanceB.speak2(request);
        System.out.println("to");
    }

    public void speak2(@Validated ScheduleRequest request) {
        instanceB.speak2(request);
        System.out.println("to");
    }

}
